//
//  MobilePhoneQuickLoginViewController.m
//  PerfectWorld
//
//  Created by dllo on 16/9/13.
//  Copyright © 2016年 LST. All rights reserved.
//

#import "MobilePhoneQuickLoginViewController.h"
#import "Masonry.h"
@interface MobilePhoneQuickLoginViewController ()

@property (nonatomic, strong)UITextField *textFieldPhone;
@property (nonatomic, strong)UITextField *textFieldPassWord;
@property (nonatomic, strong)UIButton *btn;
@end

@implementation MobilePhoneQuickLoginViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    UIButton *rightBtn = [UIButton buttonWithType:UIButtonTypeCustom];
    [rightBtn setTitle:@"登录" forState:UIControlStateNormal];
    rightBtn.frame = CGRectMake(0, 0, 50, 30);
    self.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc] initWithCustomView:rightBtn];
    [rightBtn addTarget:self action:@selector(clickRightBtn:) forControlEvents:UIControlEventTouchUpInside];
    [self creatSubView];
}
- (void)creatSubView {
    _textFieldPhone = [[UITextField alloc] init];
    _textFieldPhone.placeholder = @"请输入手机号";
    [self.view addSubview:_textFieldPhone];
    [_textFieldPhone mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo(20);
        make.width.mas_equalTo (self.view.frame.size.width - 10);
        make.height.mas_equalTo (50);
        make.left.mas_equalTo (5);
    }];
    _textFieldPassWord = [[UITextField alloc] init];
    _textFieldPassWord.placeholder = @"请输入验证码";
    [self.view addSubview:_textFieldPassWord];
    [_textFieldPassWord mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo (_textFieldPhone.mas_bottom).offset(20);
        make.left.height.mas_equalTo (_textFieldPhone);
        make.width.mas_equalTo (self.view.frame.size.width / 2);
    }];
    self.btn = [UIButton buttonWithType:UIButtonTypeCustom];
    [_btn setTitle:@"点击获取验证码" forState:UIControlStateNormal];
    _btn.backgroundColor = [UIColor cyanColor];
    [self.view addSubview:_btn];
    [_btn mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(_textFieldPassWord.mas_right).offset(10);
        make.height.mas_equalTo (_textFieldPassWord);
        make.centerY.mas_equalTo (_textFieldPassWord.mas_centerY);
        make.width.mas_equalTo (_textFieldPassWord.mas_width);
    }];
}
- (void)clickRightBtn:(UIBarButtonItem *)sender {
    
}
- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
